<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utg-8">
<title>Insert title here</title>
</head>
<body>
<div class="panel-body" id="supplier_add">

    	<form class="form-horizontal" role="form" onsubmit="javascript:return false;">

				<div class="form-group">
					<input  v-model="supplier" type="text" class="form-control"  placeholder="请输入供应商名称">
				</div>
		</form>
		
		<div class="pull-right">			
			<button type="button" @click="submit" class="btn btn-info">确定</button>
        	 <!--  <button type="button" @click="back" class="btn btn-info">返回</button>-->
		</div>
 </div>
</body>

<script type="text/javascript">
	new Vue({
		el:'#supplier_add',
		data:{
			supplier:''
		},
		methods:{
			back:function(){
				showSupplierTable();
			},
			submit:function(){
				if(this.supplier == ''){
					return ;
				}
				$.ajax({
					url:'<%=request.getContextPath()%>/s/addSupplier',
					type:'post',
					contentType:'application/json',
					data:JSON.stringify({name:this.supplier}),
					success:function(){
						showSupplierTable();
					}
				});
			}
		}
	});
</script>
</html>